// MarketShoppingGuideSalaryPlanResultApi.ts
import fetcher from "../apis/Fetcher";
import {NumberIdAndName} from "../types/BasicModels";


/**
 * 内部商品对象
 */
export interface InnerGoods {
    // 根据实际需求补充字段
    id: number;
    name: string;
    barcode: string;
}

/**
 * 导购薪资规则数据
 */
export interface MarketShoppingGuideSalaryRuleData {
    name: string;
    includedBrands: NumberIdAndName[];
    includedCategories: NumberIdAndName[];
    includedBrandTags: NumberIdAndName[];
    includedGoodsList: InnerGoods[];
    commissionPercentage?: number; // BigDecimal 转换为 number
    note?: string;
    fixedSalary?: number; // BigDecimal 转换为 number
    inMinimum: boolean;
}

/**
 * 导购薪资方案结果响应
 */
export interface MarketShoppingGuideSalaryPlanResultPlanResponse {
    minimumSalary?: number; // BigDecimal 转换为 number
    rules: MarketShoppingGuideSalaryRuleData[];
}

/**
 * 获取已复制的薪资方案结果
 * @param marketId 卖场ID
 * @param year
 * @param month
 */
export function getCopiedSalaryPlanResultPlan(
    marketId: number,
    year:number,
    month:number
) {
    return fetcher.get<MarketShoppingGuideSalaryPlanResultPlanResponse>(`markets/${marketId}/shoppingGuideSalaryPlanResults/year/${year}/month/${month}/plan`);
}
